package com.botann.projects.service;


import com.botann.projects.model.AdminUser;
import com.botann.projects.model.RequestLog;
import com.botann.projects.model.UserSecret;

import java.util.Date;
import java.util.List;

/**
 * Charging
 * AdminUserServiceIntf
 * Created by 刘山国 on 2017/11/22.
 * Copyright (c) 2017 刘山国. All rights reserved
 */
public interface AdminUserServiceIntf {

    /**
     * 请求记录
     * @param requestLog RequestLog
     */
    void saveRequestLog(RequestLog requestLog);

    UserSecret loadUserSecret(Integer userId, Integer type);
    String saveOrUpdateUserSecret(Integer userId, Integer type, String password);

    /**
     * UserDetail 即AdminUser Company Role
     * @param userId Integer
     * @return  UserDetail
     */
//    UserDetail loadUserDetail(Integer userId);

    /**
     * AdminUser 用于登录
     * @param username  String
     * @return AdminUser
     */
    AdminUser loadAdminUserByUsername(String username);

    AdminUser loadAdminUserByPhone(String username);

    List<AdminUser> loadAdminUsers(String username, String name, Integer roleId, Date startDate, Date endDate);

    /**
     * 添加管理员 AdminUser
     * 注意: 判断登录名称是否重复
     * @param user  AdminUser
     */
    AdminUser saveAdminUser(AdminUser user);

    void deleteAdminUsers(String idsJson);

    void updateAdminUserPassword(Integer userId, String password);
    void updateAdminUserPassword(String oldPassword, String password);

    void updateAdminUser(String adminUserJson);

}
